#include <stdio.h>

int main() {
	char arr[51] = {0};
	scanf("%s", arr);
	char *p = arr;
	while (*p) {
		if (*p >= 'a' && *p <= 'z' || *p >= 'A' && *p <= 'Z') {
			printf("%c", *p);

		} else if (*p >= '0' && *p <= '9') {
			int num = 0;
			int flag = 0;
			while (*p >= '0' && *p <= '9') {
				num = num * 10 + (*p - '0');
				p++;
				flag++;
			}
			for (int i = 0; i < num - 1; i++) {
				printf("%c", *(p - flag - 1 ));
			}
			continue;
		}
		p++;
	}

	return 0;
}